import request from "@/utils/request";

export const getCategoryList=(id)=>request.get('/category',{params:{id}})


export const getCategoryfilter=(id)=>request.get('/category/sub/filter',{params:{id}})

/**
 * @description: 获取导航数据
 * @data { 
     categoryId: 1005000 ,
     page: 1,
     pageSize: 20,
     sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
   } 
 * @return {*}
 */
export const getSubCategoryAPI=data=>request.post('/category/goods/temporary',data)


export const getGoodDetail=(id)=>request.get('/goods',{params:{id}})

/**
 * 获取热榜商品
 * @param {Number} id - 商品id
 * @param {Number} type - 1代表24小时热销榜 2代表周热销榜
 * @param {Number} limit - 获取个数
 */
export const fetchHotGoodsAPI=({id,type,limit=3})=>request.get('/goods/hot',{params:{limit,id,type}})